import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
} from '@nestjs/common'
import { InventoryService } from './inventory.service'

@Controller('inventory')
export class InventoryController {
  constructor(private readonly inventoryService: InventoryService) { }

  @Post('add')
  add(@Body() body) {
    return this.inventoryService.add(body)
  }

  @Post('del')
  del(@Body() body) {
    return this.inventoryService.del(body.id as number)
  }

  @Post('edit')
  edit(@Body() body) {
    return this.inventoryService.update(body)
  }

  @Post('page')
  page(@Body() body) {
    return this.inventoryService.getPageList(body)
  }

  @Post('getInventoryDetail')
  getInventoryDetail(@Body() body) {
    return this.inventoryService.getDetailByCode(body.code)
  }

  @Post('detailsPage')
  detailsPage(@Body() body) {
    return this.inventoryService.detailsPage(body)
  }

  @Post('inventory')
  inventory(@Body() body) {
    return this.inventoryService.inventory(body)
  }

  @Post('inventoryAll')
  inventoryAll(@Body() body) {
    return this.inventoryService.inventoryAll(body)
  }
}
